package baibeiwallet.activity;

import android.support.v4.app.Fragment;
import android.view.View;

import com.alm.token.R;
import com.alm.token.base.BaseActivity;
import com.alm.token.ui.persenter.MyPreenter;
import com.alm.token.utils.ActionBarHelper;
import com.alm.token.utils.ItemTitlePagerAdapter;
import com.alm.token.widget.CustomTabLayout;
import com.alm.token.widget.NoScrollViewPager;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;

public class InprotWalletActivity1 extends BaseActivity {
    @BindView(R.id.tab)
    CustomTabLayout tab;
    @BindView(R.id.view_pager)
    NoScrollViewPager viewPager;

    @Override
    protected MyPreenter initPreenter() {
        return null;
    }

    @Override
    protected int getContentViewId() {
        return R.layout.activity_message;
    }

    @Override
    protected void initVariables() {
        new ActionBarHelper(this).setTitle(getString(R.string.menu_hint_item4));
    }

    @Override
    protected void initViews() {
        initTab();
    }
    private void initTab() {
        String[] tabNames = {getString(R.string.wallet_hint_table1), getString(R.string.wallet_hint_table2),getString(R.string.wallet_hint_table3)};
        List<Fragment> fragmentList = new ArrayList<>();
        fragmentList.add(InportFrag.newInstance(0));
        fragmentList.add(InportFrag.newInstance(1));
        fragmentList.add(InportFrag.newInstance(2));


        tab.setVisibility(View.VISIBLE);
        tab.setItemLayout(R.layout.item_message_tab);
        tab.setTabNames(tabNames);
        tab.notifyChange();
        tab.setViewPager(viewPager);


        viewPager.setAdapter(new ItemTitlePagerAdapter(getSupportFragmentManager(),
                fragmentList, tabNames));
        viewPager.setOffscreenPageLimit(3);
//       if(getIntent().getIntExtra("type", 0)==1){
//           tab.setSelectedView(1);
//           viewPager.setCurrentItem(1);
//       }
    }
    @Override
    protected void loadData() {

    }

    @Override
    public void onClick(View v) {

    }
}
